< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03120311.xhp

(section: trim) (bookmark: bm_id3150616)
Trim function

Trim 関数

Trim Function [Runtime]
Trim 関数 [実行時](hd_id3150616.1)

Removes all leading and trailing spaces from a string expression.
文字列表式の末尾および先頭にあるスペース記号を、すべて削除します。(par_id3149177.2)

(/section: trim)

Syntax:
構文:(hd_id3159157.3)

Trim( Text As String )
Trim( Text As String )(par_id3155341.4)

Return value:
戻り値:(hd_id3155388.5)

String
文字列(par_id3143228.6)

Parameters:
パラメータ:(hd_id3145609.7)

Text: Any string expression.
Text: 処理をする文字列表現。(par_id3159414.8)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3148663.10)

Sub ExampleSpaces
Sub ExampleSpaces(par_id3150398.11)

Dim sText2 as String,sText as String,sOut as String
Dim sText2 as String,sText as String,sOut as String(par_id3153525.12)

sText2 = " <*Las Vegas*> "
sText2 = " <*Las Vegas*> "(par_id3154908.13)

sOut = "'"+sText2 +"'"+ Chr(13)
sOut = "'"+sText2 +"'"+ Chr(13)(par_id3144760.15)

sText = Ltrim(sText2) REM sText = "<*Las Vegas*> "
sText = Ltrim(sText2) REM sText = "<*Las Vegas*> "(par_id3151383.16)

sOut = sOut + "'"+sText +"'" + Chr(13)
sOut = sOut + "'"+sText +"'" + Chr(13)(par_id3151044.17)

sText = Rtrim(sText2) REM sText = " <*Las Vegas*>"
sText = Rtrim(sText2) REM sText = " <*Las Vegas*>"(par_id3159149.18)

sOut = sOut +"'"+ sText +"'" + Chr(13)
sOut = sOut + "'"+sText +"'" + Chr(13)(par_id3150449.19)

sText = Trim(sText2) REM sText = "<*Las Vegas*>"
sText = Trim(sText2) REM sText = " <*Las Vegas*> "(par_id3149562.20)

sOut = sOut +"'"+ sText +"'"
sOut = sOut +"'"+ sText +"'"(par_id3161831.21)

MsgBox sOut
MsgBox sOut(par_id3146120.22)

end sub
end sub(par_id3145364.23)


< Prev / Next >